# Contributor: Alex McGrath <amk@amk.ie>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=sublime-music
pkgver=0.11.16
pkgrel=4
pkgdesc="A native, GTK3 Subsonic client for the Linux Desktop"
url="https://sublimemusic.app"
arch="all !s390x !ppc64le" # py3-mpv doesnt work on these
options="!check" # tests fail
license="GPL-3.0-or-later"
depends="
	libnotify
	py3-bleach
	py3-bottle
	py3-dataclasses-json
	py3-dateutil
	py3-deepdiff
	py3-fuzzywuzzy
	py3-gobject3
	py3-keyring
	py3-levenshtein
	py3-mpv
	py3-peewee
	py3-pychromecast
	py3-requests
	py3-semver
	python3
	"
makedepends="poetry py3-build py3-installer py3-wheel"
source="https://gitlab.com/sublime-music/sublime-music/-/archive/v$pkgver/sublime-music-v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-v$pkgver"

build() {
	# set git dir for poetry workaround
	GIT_DIR=. python3 -m build \
		--skip-dependency-check \
		--no-isolation \
		--wheel
}

package() {
	python3 -m installer -d "$pkgdir" --compile-bytecode 0 \
		dist/sublime_music-$pkgver-py3-none-any.whl

	install -Dm644 "$builddir"/sublime-music.desktop \
		-t "$pkgdir"/usr/share/applications
	install -Dm644 "$builddir"/logo/icon.svg \
		"$pkgdir"/usr/share/icons/hicolor/scalable/apps/sublime-music.svg
}

sha512sums="
d2c0e825efce5bd6d89ae865290fa8c1f6d01bb355f7dca5eece3641cd0180adc42c72747b00182e02ad6cf7bf993fb8cd56a4bc757c9cd406d0067b791fd683  sublime-music-v0.11.16.tar.gz
"
